package com.mz.ozy.adapter;

import android.text.TextUtils;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.mz.ozy.R;
import com.mz.ozy.utils.glideUtils.GlideUtils;

import java.util.List;

/**
 * Created by administrator on 2018/11/21.
 */
public class CommentImageAdapter extends BaseQuickAdapter<String, BaseViewHolder> {

    public CommentImageAdapter(@Nullable List<String> data) {
        super(R.layout.comment_img_item, data);
    }
//    public CommentImageAdapter(@Nullable List<Integer> data) {
//        super(R.layout.comment_img_item, data);
//    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {
        GlideUtils.loadImg(mContext, helper.getView(R.id.iv_comment_img), item);
        if (TextUtils.isEmpty(item)) {
            GlideUtils.loadImg(mContext, helper.getView(R.id.iv_comment_img), R.mipmap.default_user_head);
        } else {
            GlideUtils.loadImg(mContext, helper.getView(R.id.iv_comment_img), item);
        }
    }

}
